package com.tanhua.es.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.elasticsearch.common.geo.GeoPoint;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.GeoPointField;

/**
 * @author 西楚霸王
 * @date 2020/11/30 12:23
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "tanhua",type = "user_location",shards = 6,replicas = 2)
public class UserLocationES {

    @Id
    private Long userId; //用户id
    @GeoPointField
    private GeoPoint location;// y:纬度 x:经度 注意位置

    @Field(type = FieldType.Keyword)
    private String address;//位置描述

    @Field(type = FieldType.Long)
    private Long created; //创建时间

    @Field(type = FieldType.Long)
    private Long updated; //更新时间

    @Field(type = FieldType.Long)
    private Long lastUpdated;//上次更新时间
}
